function TPS_steps(onDevice,onDevicetype,offDevice,offDevicetype,onauto,offauto){
    console.log(onDevice);
    console.log(offDevice);
    console.log(onauto);
    console.log(offauto);
    console.log(onDevicetype);
    console.log(toRaw(onDevicetype));
    console.log(offDevicetype);
    let Switch=onDevicetype[0]=='电缆分接箱'? onDevice.match(/箱\s*(\w+)\s*开关/)[1]:onDevice.match(/[0-9]+T[0-9]/);
    const On_Auto_demo=[
        '汇报调度（申请进行遥控）。',
        '再经调度令。',
        '切换'+Switch+'开关“远方/就地”转换开关至“就地”位置。',
        '切换'+Switch+'开关“远方/就地”转换开关至“远方”位置。',
    ]
    let Auto_blank=onauto==true? On_Auto_demo:Array.from({length:On_Auto_demo.length},()=> '');

    let new_steps=['核对'+onDevice+'名称、编号及位置正确。'];
    if(onDevicetype[0]=='电缆分接箱'){
        new_steps.push('检查'+Switch+'开关SF6气压表气压指示正常。');
    }
    if(onDevicetype[1]>0){
        new_steps.push('检查'+Switch+'开关在分闸位置。');
        for(let i=1;i<onDevicetype[1]+1;i++){
            new_steps.push('合上'+Switch+i+'刀闸。');
            new_steps.push('检查'+Switch+i+'刀闸在合上位置。');
        }
    }
    new_steps.push(Auto_blank[0]);
    new_steps.push(Auto_blank[1]);
    new_steps.push(Auto_blank[2]);
    new_steps.push('合上'+Switch+'开关。');
    new_steps.push('检查'+Switch+'开关在合闸位置。');
    new_steps.push(Auto_blank[3]);

    
    Switch=offDevicetype[0]=='电缆分接箱'? offDevice.match(/箱\s*(\w+)\s*开关/)[1]:offDevice.match(/[0-9]+T[0-9]/);
    let Off_Auto_demo=[
        '汇报调度（申请进行遥控）。',
        '再经调度令。',
        '切换'+Switch+'开关“远方/就地”转换开关至“就地”位置。',
    ]
    Auto_blank=offauto==true? Off_Auto_demo:Array.from({length:Off_Auto_demo.length},()=> '');

    new_steps.push('核对'+offDevice+'名称、编号及位置正确。');
    if(offDevicetype[0]=='电缆分接箱'){
        new_steps.push('检查'+Switch+'开关SF6气压表气压指示正常。');
    }
    new_steps.push(Auto_blank[0]);
    new_steps.push(Auto_blank[1]);
    new_steps.push(Auto_blank[2]);
    new_steps.push('断开'+Switch+'开关。');
    new_steps.push('检查'+Switch+'开关在分闸位置。');
    if(offDevicetype[1]>0){
        for(let i=offDevicetype[1];i>0;i--){
            new_steps.push('拉开'+Switch+i+'刀闸。');
            new_steps.push('检查'+Switch+i+'刀闸拉开位置。');
        }
    }
    return new_steps.filter(item => item!='')
}



export function TPS_Output(task,onDevice,onDevicetype,offDevice,offDevicetype,onauto,offauto){
    // let RodNum=PF_name.match(/#([0-9]+)\s*杆*塔*/)[1];
    // const TPS_models={
    //     '运行-热备用':RingClosure([1,0,0],PF_name,blade,type),
    //     '运行-冷备用':DB_Run2Maintenance([1,1,0],PF_name,blade,type),
    //     '运行-检修':DB_Run2Maintenance([1,1,1],PF_name,blade,type),
    //     '热备用-冷备用':DB_Run2Maintenance([0,1,0],PF_name,blade,type),
    //     '热备用-检修':DB_Run2Maintenance([0,1,1],PF_name,blade,type),
    //     '冷备用-检修':DB_Run2Maintenance([0,0,1],PF_name,blade,type),
    //     '检修-冷备用':DB_Maintenance2Run([1,0,0],PF_name,blade,type),
    //     '检修-热备用':DB_Maintenance2Run([1,1,0],PF_name,blade,type),
    //     '检修-运行':DB_Maintenance2Run([1,1,1],PF_name,blade,type),
    //     '冷备用-热备用':DB_Maintenance2Run([0,1,0],PF_name,blade,type),
    //     '冷备用-运行':DB_Maintenance2Run([0,1,1],PF_name,blade,type),
    //     '热备用-运行':DB_Maintenance2Run([0,0,1],PF_name,blade,type),
    // }
    let steps=TPS_steps(onDevice,onDevicetype,offDevice,offDevicetype,onauto,offauto)
    
    // let Loc=PF_name.match(/杆*塔*\s*[\u4e00-\u9fa5]+公用台变*/)[0].substring(1).replace(/\s+/g,'');
    let Loc=onDevice;
    let Renwu=task
    addticket2page(Loc,Renwu,steps)
    

}